/*
 * Copyright 2000-2020 ALPHA LAB.Inc All Rights Reserved.
 */
package com.alphalab.framework.test.cudTest; 

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 
import com.alphalab.framework.role.GeneralRole; 
import com.alphalab.framework.test.queryTest.ProjectItem;
import com.alphalab.framework.test.queryTest.ProjectItemTransfer;
import com.alphalab.framework.test.queryTest.ProjectItemVo;

/**
 * ProjectItemRole.
 * @author allen 
 * @version 1.0.0 2018年1月7日
 */
@Service 
@Transactional
public class ProjectItemRole extends GeneralRole<ProjectItemVo, ProjectItem, IProjectItemDao, ProjectItemTransfer> 
	implements IProjectItemRole {

	/**
	 * 初始化时注入projectItemDao到ProjectItemRole中.
	 * @param projectItemDao projectItemDao
	 */  
	@Autowired
	public void setprojectItemQueryDao(final IProjectItemDao projectItemDao) {
		super.setEntityDao(projectItemDao);
	}
	
	/**
	 * 手动new一个转换器并set到父类中.
	 */
	@Override
	public ProjectItemTransfer getEntityTransfer() {
		try {
			return super.getEntityTransfer();
		} catch (RuntimeException e) { 
			super.setEntityTransfer(new ProjectItemTransfer());
		}
		return super.getEntityTransfer();
	}
	
}
